﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<UnfriendlyFire.Models.AuthoredScenario>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Scenarios
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Scenarios</h2>
    <p>
        A scenario is description of a conflict between armed forces within a theater. The
        scenario includes the a set of possible units available to the armed forces. The
        armed forces in a scenario will have a series of objectives that must be met. The
        armed force that meets the most of their objectives wins.</p>
    <h2>
        Existing Scenarios</h2>
    <table>
        <tr>
            <th>
            </th>
            <th>
            </th>
            <th>
                Name
            </th>
            <th>
                Description
            </th>
            <th>
                Author's Email
            </th>
        </tr>
        <% 
            
            int count = 0;
            foreach (var item in Model)
            { %>
        <tr class="<%: count % 2 == 0 ? "table-row-even" : "table-row-odd" %>">
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { id = item.ScenarioId })%>
                |
                <%: Html.ActionLink("Details", "Details", new { id = item.ScenarioId })%>
                |
                <%: Html.ActionLink("Delete", "Delete", new { id = item.ScenarioId })%>
            </td>
            <td>
                <img src="<%: item.Icon %>" width="32" height="32" alt="Scenario Icon" />
            </td>
            <td>
                <%: item.Name%>
            </td>
            <td>
                <%: item.Description%>
            </td>
            <td>
                <%: item.AuthorEmail%>
            </td>
        </tr>
        <% count++;
            } %>
    </table>
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
</asp:Content>
